/**
 * Choicesoft.com.cn Inc.
 * Copyright (c) 2004-2018 All Rights Reserved.
 */
package com.test.springboot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenxubing
 * @version $Id: ApplicationMain.java, v 0.1 2018-11-08 4:37 PM chenxubing Exp $$
 */
@SpringBootApplication
@RestController
public class ApplicationMain {
    public static void main(String[] args) {
        SpringApplication.run(ApplicationMain.class, args);
    }

    @Autowired
    private Sender sender;

    @PostMapping("/send")
    public String send(@RequestBody String msg) {
        sender.send(msg);
        return "send msg:" + msg;
    }

    @PostMapping("/res")
    public String res(@RequestBody String v) {
        return "send msg:" + v;
    }
}
